package mapper.impl;

import entity.Singer;
import mapper.SingerMapper;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class SingerMapperImpl implements SingerMapper {
    private SqlSession session;

    public void setSession(SqlSession session) {
        this.session = session;
    }

    @Override
    public List<Singer> getAllSinger() {
        return session.getMapper(SingerMapper.class).getAllSinger();
    }

    @Override
    public Singer getSingerById(String singerId) {
        return session.getMapper(SingerMapper.class).getSingerById(singerId);
    }

    @Override
    public int addSinger(Singer singer) {
        return session.getMapper(SingerMapper.class).addSinger(singer);
    }

    @Override
    public int updateSinger(Singer singer) {
        return session.getMapper(SingerMapper.class).updateSinger(singer);
    }

    @Override
    public int deleteSingerById(String singerId) {
        return session.getMapper(SingerMapper.class).deleteSingerById(singerId);
    }


}
